<template>
  <div>
    <el-form :inline="true" :model="searchItem" class="demo-form-inline" size="mini">
      <el-form-item class="cls-choose">
        <el-select v-model="searchItem.hasDone" placeholder="是否处理">
          <el-option label="已回复" value="1"></el-option>
          <el-option label="未处理" value="2"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item class="reason-cls">
        <el-input v-model="searchItem.keywords" placeholder="请输入您的问题描述关键词"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="addSuggest">发布问题</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {
      searchItem: {
        hasDone: '',
        keywords: ''
      }
    }
  },
  methods: {
    onSubmit() {
      this.$emit('searchData', {
        isReaply: this.searchItem.hasDone,
        keywords: this.searchItem.keywords
      })
    },
    addSuggest() {
      this.$emit('openSuggest', true)
    }
  }
}
</script>

<style lang="scss" scoped>
.links-set {
  .el-col {
    line-height: 34px;

    &:first-of-type {
      text-align: right;
      margin-right: 20px;
      font-size: 14px;
      font-weight: 500;
    }
  }
}

.cls-choose {
  width: 100px;

  &:first-of-type {
    width: 120px;
  }
}

.reason-cls {
  .el-input {
    width: 220px;
  }
}
</style>
